/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2018-2023.
 * Description: irq: merge high-precision timer can reduce interrupts and context switches
 * Author: langfei
 * Create: 2023-12-15
 */

#ifndef _TIME_HIGH_PRECISION_H_
#define _TIME_HIGH_PRECISION_H_

#ifdef CONFIG_EULEROS_MERGE_TIMER_IRQ
DECLARE_PER_CPU(int, period_divisor);
extern int correct_proc_stat;

extern bool hrtimer_norestart_enable(struct tick_sched *ts);
extern bool period_divisor_valid(int cpu);
extern bool get_hrtimer_hres_enabled(void);
#if defined(CONFIG_X86_64)
extern void change_to_deadline(void *arg);
extern void change_to_period(void *arg);
#endif
#else
static inline bool period_divisor_valid(int cpu)
{
	return true;
}
#endif /* CONFIG_EULEROS_MERGE_TIMER_IRQ */

#endif /* _TIME_HIGH_PRECISION_H_ */
